package com.asj.vivo.lock.service;

import static com.asj.enums.DeviceIdentifierDictEnums.json_key_deviceCode;

import android.content.Context;
import android.content.SharedPreferences;

public class PrefsHelper {
    private static final String PREFS_NAME = "MyAppPrefs";
    private final SharedPreferences sharedPreferences;

    public PrefsHelper(Context context) {
        sharedPreferences = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);
    }

    public void setStringValue(String value) {
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putString(json_key_deviceCode.getValue(), value);
        editor.apply();
    }

    public String getStringValue(String key, String defaultValue) {
        return sharedPreferences.getString(key, defaultValue);
    }

    // 可以添加更多方法来处理不同类型的数据
}